const {resolve} = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin'); //引入html的插件


module.exports={
    entry:resolve(__dirname,'./src/index.js'),
    output:{
        filename:'index.js',
        path:resolve(__dirname,'./dist'),
    },
    plugins:[
         new HtmlWebpackPlugin({
             template:resolve(__dirname,'./public/index.html'),
         })
    ],
    mode:'development',
    devServer:{
       port:8888,
       open:true,
       contentBase:resolve(__dirname,'dist'),
       compress:true,
    }
}